package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维护-维护完成情况
type vehicleMaintainStatus int

var VehicleMaintainStatus vehicleMaintainStatus

// 部分完成
func (c *vehicleMaintainStatus) MaintainPart() int {
	return 1
}

// 维护完成
func (c *vehicleMaintainStatus) MaintainAll() int {
	return 2
}

func (c *vehicleMaintainStatus) ToText(value int) string {
	switch value {

	case 1:
		return "部分完成"

	case 2:
		return "维护完成"

	}
	return ""
}

func (c *vehicleMaintainStatus) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainStatus) ToValue(text string) int {
	switch text {

	case "部分完成":
		return 1

	case "维护完成":
		return 2

	}
	return 0
}
